﻿/*
Copyright (c) 2008 William Duff

Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights 
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
*/

using System;
using System.Collections.Generic;
using System.Text;

namespace LiveUpload.Facebook
{
    public class PhotoTag
    {
        #region Constructors

        /// <summary>
        /// Constructs a photo tag object to represent a user identified in a region of a photo.
        /// </summary>
        public PhotoTag(string photoId, string subjectId, string text, float x, float y,
            double createdUnixTimestamp)
        {
            this.photoId = photoId;
            this.subjectId = subjectId;
            this.text = text;
            this.x = x;
            this.y = y;
            this.created = FacebookParser.ConvertFromUnixTimestamp(createdUnixTimestamp);
            this.createdUnixTimestamp = createdUnixTimestamp;
        }

        #endregion

        #region Private Fields
        
        private string photoId;
        private string subjectId;
        private string text;
        private float x;
        private float y;
        private DateTime? created;
        private double createdUnixTimestamp;

        #endregion

        #region Public Fields

        /// <summary>
        /// A unique identifier for the photo containing this tag.
        /// </summary>
        public string PhotoId
        {
            get { return this.photoId; }
            set { this.photoId = value; }
        }

        /// <summary>
        /// The id of the user tagged in this photo.
        /// </summary>
        public string SubjectId
        {
            get { return this.subjectId; }
            set { this.subjectId = value; }
        }

        /// <summary>
        /// Some text identifying the person being tagged.
        /// </summary>
        public string Text
        {
            get { return this.text; }
            set { this.text = value; }
        }

        /// <summary>
        /// The horizontal position of the tag, as a percentage from 0 to 100, from the left of the 
        /// photo.
        /// </summary>
        public float X
        {
            get { return this.x; }
            set { this.x = value; }
        }
        /// <summary>
        /// The vertical position of the tag, as a percentage from 0 to 100, from the top of the 
        /// photo.
        /// </summary>
        public float Y
        {
            get { return this.y; }
            set { this.y = value; }
        }

        /// <summary>
        /// The date the tag was created. Null means it has not been created yet.
        /// </summary>
        public DateTime? Created
        {
            get { return this.created; }
            set { this.created = value; }
        }

        /// <summary>
        /// The date the photo was created in Unix time. Zero means it has not been created yet.
        /// </summary>
        public double CreatedUnixTimestamp
        {
            get { return this.createdUnixTimestamp; }
            set { this.createdUnixTimestamp = value; }
        }

        #endregion
    }
}
